{extend name="base/common"}

{block name="style"}
<style type="text/css">
    .con-text{
        width: 100%;
        height: 100px;
    }
</style>
{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>网站设置</h2>
        <ol class="breadcrumb">
            <li>
                <a href="index.html">Admin</a>
            </li>
            <li class="active">
                <strong>Config</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">

    </div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeIn">
    <div class="row">
        <div class="col-lg-12">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    {volist name="Think.config.CONFIG_GROUP_LIST" id="group"}
                    <li {eq name="id" value="$key"}class="active"{/eq}>
                        <a href="{:Url('?id='.$key)}">{$group}配置</a>
                    </li>
                    {/volist}
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active">
                        <div class="panel-body">
                            <form action="{:Url('save')}" method="post" class="form-horizontal">
                                {volist name="list" id="config"}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">{$config.title}</label>
                                    <div class="col-sm-10">
                                        {switch name="config.type"}
                                            {case value="0"}<input type="text" class="form-control" name="config[{$config.name}]" value="{$config.value}">{/case}
                                            {case value="1"}<input type="text" class="form-control" name="config[{$config.name}]" value="{$config.value}">{/case}
                                            {case value="2"}<textarea class="form-control" name="config[{$config.name}]" rows="4">{$config.value}</textarea>{/case}
                                            {case value="3"}<textarea class="form-control" name="config[{$config.name}]" rows="4">{$config.value}</textarea>{/case}
                                            {case value="4"}
                                            <select class="form-control m-b" name="config[{$config.name}]">
                                                {volist name=":parse_config_attr($config['extra'])" id="vo"}
                                                <option value="{$key}" {eq name="config.value" value="$key"}selected{/eq}>{$vo}</option>
                                                {/volist}
                                            </select>
                                            {/case}
                                        {/switch}
                                    </div>
                                </div>
                                {/volist}
                                <div class="form-group">
                                    <div class="col-lg-offset-2 col-lg-10">
                                        <button class="btn btn-primary ajax-post" type="submit" target-form="form-horizontal" >添加</button>
                                        <button class="btn" onclick="javascript:history.back(-1);return false;">返 回</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="script"}

{/block}